<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            站点名称：<input type="text" name="name"/>
                        </li>
<!--
                        <li>
                            站点标题：<input type="text" name="title"/>
                        </li>

                        <li>
                            站点Logo：<input type="text" name="logo"/>
                        </li>

                        <li>
                            站点域名：<input type="text" name="domain"/>
                        </li>

                        <li>
                            描述：<input type="text" name="description"/>
                        </li>

                        <li>
                            关键字：<input type="text" name="keywords"/>
                        </li>

                        <li>
                            主题：<input type="text" name="theme"/>
                        </li>-->


                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="cms:site:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="cms:site:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="cms:site:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="cms:site:export">
                    <i class="fa fa-download"></i> 导出
             </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "cms/site";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "站点",
            search: false,
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'name',
                    title: '站点名称',
                    sortable: true
                },
                {
                    field: 'title',
                    title: '站点标题',
                    sortable: true
                },
                // {
                //     field: 'logo',
                //     title: '站点Logo',
                //     sortable: true
                // },
                // {
                //     field: 'domain',
                //     title: '站点域名',
                //     sortable: true
                // },
                {
                    field: 'description',
                    title: '描述',
                    sortable: true
                },
                {
                    field: 'keywords',
                    title: '关键字',
                    sortable: true
                },
                {
                    field: 'theme',
                    title: '主题',
                    sortable: true
                },
                // {
                //     field: 'copyright',
                //     title: '版权信息',
                //     sortable: true
                // },
                // {
                //     field: 'customIndexView',
                //     title: '自定义站点首页视图',
                //     sortable: true
                // },
                // {
                //     field: 'createBy',
                //     title: '创建者',
                //     sortable: true
                // },
                // {
                //     field: 'createDate',
                //     title: '创建时间',
                //     sortable: true
                // },
                // {
                //     field: 'updateBy',
                //     title: '更新者',
                //     sortable: true
                // },
                // {
                //     field: 'updateDate',
                //     title: '更新时间',
                //     sortable: true
                // },
                {
                    field: 'remarks',
                    title: '备注信息',
                    sortable: true
                },
                // {
                //     field: 'delFlag',
                //     title: '删除标记',
                //     sortable: true
                // },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>